package com.ycq.webssm.controller2;

import com.alibaba.fastjson.JSON;
import com.ycq.webssm.domain.UserInfo;
import com.ycq.webssm.srevice.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;



@Controller("userController")
@RequestMapping("/userInfo")
public class UserInfoController {

    @Autowired
    UserInfoService userInfoService;


    @RequestMapping(value = "/getUserInfo")
    @ResponseBody
    public String getUserInfo() {
        List<UserInfo> userInfo = null;
        try {
            userInfo = userInfoService.getUserInfo();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return JSON.toJSONString(userInfo);
    }




}
